#pragma once
#include "f2c.h"

using namespace System;

namespace SmartMathLibrary
{
  namespace LasoPack
  {
    public ref class ManagedLasoProvider
    {
      public:
        static double log(double x);

        static double sqrt(double x);

        static double atan(double x);

        static double pow_dd(double x, double y);

        static double pow_dd(doublereal *ap, doublereal *bp);

        static double d_sign(doublereal *a, doublereal *b);

        static double r_sign(real *a, real *b);

        static int daxpy_(integer *n, doublereal *da, doublereal *dx, integer
          *incx, doublereal *dy, integer *incy);

        static int dcopy_(integer *n, doublereal *dx, integer *incx, doublereal
          *dy, integer *incy);

        static doublereal ddot_(integer *n, doublereal *dx, integer *incx,
          doublereal *dy, integer *incy);

        static int dilaso_(U_fp op, U_fp iovect, integer *n, doublereal *xl,
          doublereal *xr, integer *nfig, integer *nperm, integer *nmval,
          doublereal *val, integer *nmvec, integer *maxvec, doublereal *vec,
          integer *nblock, integer *maxop, integer *maxj, doublereal *work,
          integer *ind, integer *ierr);

        static int dippla_(S_fp op, S_fp iovect, integer *n, doublereal *xl,
          doublereal *xr, integer *np, integer *nperm, integer *nop, integer
          *nmval, doublereal *val, integer *nmvec, doublereal *vec, integer
          *nblock, doublereal *h__, doublereal *hv, doublereal *p, doublereal
          *q, doublereal *bound, doublereal *d__, doublereal *deltal,
          doublereal *deltar, logical *raritz, doublereal *eps, integer *ierr);

        static int diwla_(S_fp op, S_fp iovect, integer *n, integer *nband,
          doublereal *xl, doublereal *xr, integer *nfig, integer *nperm,
          doublereal *val, integer *nmvec, integer *maxvec, doublereal *vec,
          integer *nblock, integer *maxop, integer *maxj, integer *nop,
          doublereal *p1, doublereal *p0, doublereal *res, doublereal *tau,
          doublereal *otau, doublereal *t, doublereal *alp, doublereal *bet,
          doublereal *s, doublereal *p2, doublereal *bound, doublereal *atemp,
          doublereal *vtemp, doublereal *d__, integer *ind, logical *raritz,
          doublereal *deltal, doublereal *deltar, doublereal *eps, integer
          *ierr);

        static int dlabax_(integer *n, integer *nband, doublereal *a,
          doublereal *x, doublereal *y);

        static int dlabcm_(integer *n, integer *nband, integer *nl, integer*nr,
          doublereal *a, doublereal *eigval, integer *lde, doublereal *eigvec,
          doublereal *atol, doublereal *artol, doublereal *bound, doublereal
          *atemp, doublereal *d__, doublereal *vtemp);

        static int dlabfc_(integer *n, integer *nband, doublereal *a,
          doublereal *sigma, integer *number, integer *lde, doublereal *eigvec,
          integer *numl, integer *ldad, doublereal *atemp, doublereal *d__,
          doublereal *atol);

        static int dlaeig_(integer *n, integer *nband, integer *nl, integer*nr,
          doublereal *a, doublereal *eigval, integer *lde, doublereal *eigvec,
          doublereal *bound, doublereal *atemp, doublereal *d__, doublereal
          *vtemp, doublereal *eps, doublereal *tmin, doublereal *tmax);

        static int dlager_(integer *n, integer *nband, integer *nstart,
          doublereal *a, doublereal *tmin, doublereal *tmax);

        static int dlaran_(integer *n, doublereal *x);

        static int dmvpc_(integer *nblock, doublereal *bet, integer *maxj,
          integer *j, doublereal *s, integer *number, doublereal *resnrm,
          doublereal *orthcf, doublereal *rv);

        static doublereal dnrm2_(integer *n, doublereal *dx, integer *incx);

        static int dortqr_(integer *nz, integer *n, integer *nblock, doublereal
          *z__, doublereal *b);

        static int dscal_(integer *n, doublereal *da, doublereal *dx, integer
          *incx);

        static int dswap_(integer *n, doublereal *dx, integer *incx, doublereal
          *dy, integer *incy);

        static int dvsort_(integer *num, doublereal *val, doublereal *res,
          integer *iflag, doublereal *v, integer *nmvec, integer *n,
          doublereal*vec);

        static int dnlaso_(U_fp op, U_fp iovect, integer *n, integer *nval,
          integer *nfig, integer *nperm, integer *nmval, doublereal *val,
          integer *nmvec, doublereal *vec, integer *nblock, integer *maxop,
          integer *maxj, doublereal *work, integer *ind, integer *ierr);

        static int dnppla_(S_fp op, S_fp iovect, integer *n, integer *nperm,
          integer *nop, integer *nmval, doublereal *val, integer *nmvec,
          doublereal *vec, integer *nblock, doublereal *h__, doublereal *hv,
          doublereal *p, doublereal *q, doublereal *bound, doublereal *d__,
          doublereal *delta, logical *small, logical *raritz, doublereal *eps);

        static int dnwla_(S_fp op, S_fp iovect, integer *n, integer *nband,
          integer *nval, integer *nfig, integer *nperm, doublereal *val,
          integer *nmvec, doublereal *vec, integer *nblock, integer *maxop,
          integer *maxj, integer *nop, doublereal *p1, doublereal *p0,
          doublereal *res, doublereal *tau, doublereal *otau, doublereal *t,
          doublereal *alp, doublereal *bet, doublereal *s, doublereal *p2,
          doublereal *bound, doublereal *atemp, doublereal *vtemp, doublereal
          *d__, integer *ind, logical *small, logical *raritz, doublereal
          *delta, doublereal *eps, integer *ierr);

        static real urand_(integer *iy);

        static int sscal_(integer *n, real *sa, real *sx, integer *incx);

        static int sortqr_(integer *nz, integer *n, integer *nblock, real *z__,
          real *b);

        static real snrm2_(integer *n, real *sx, integer *incx);

        static int snppla_(S_fp op, S_fp iovect, integer *n, integer *nperm,
          integer *nop, integer *nmval, real *val, integer *nmvec, real *vec,
          integer *nblock, real *h__, real *hv, real *p, real *q, real *bound,
          real *d__, real *delta, logical *small, logical *raritz, real *eps);

        static int snlaso_(U_fp op, U_fp iovect, integer *n, integer *nval,
          integer *nfig, integer *nperm, integer *nmval, real *val, integer
          *nmvec, real *vec, integer *nblock, integer *maxop, integer *maxj,
          real *work, integer *ind, integer *ierr);

        static int smvpc_(integer *nblock, real *bet, integer *maxj, integer *j,
          real *s, integer *number, real *resnrm, real *orthcf, real *rv);

        static int slaran_(integer *n, real *x);

        static int slager_(integer *n, integer *nband, integer *nstart, real *a,
          real *tmin, real *tmax);

        static int slaeig_(integer *n, integer *nband, integer *nl, integer*nr,
          real *a, real *eigval, integer *lde, real *eigvec, real *bound, real
          *atemp, real *d__, real *vtemp, real *eps, real *tmin, real *tmax);

        static int slabfc_(integer *n, integer *nband, real *a, real *sigma,
          integer *number, integer *lde, real *eigvec, integer *numl, integer
          *ldad, real *atemp, real *d__, real *atol);

        static int slabcm_(integer *n, integer *nband, integer *nl, integer*nr,
          real *a, real *eigval, integer *lde, real *eigvec, real *atol, real
          *artol, real *bound, real *atemp, real *d__, real *vtemp);

        static int slabax_(integer *n, integer *nband, real *a, real *x, real
          *y);

        static int siwla_(S_fp op, S_fp iovect, integer *n, integer *nband,
          real *xl, real *xr, integer *nfig, integer *nperm, real *val,
          integer*nmvec, integer *maxvec, real *vec, integer *nblock, integer
          *maxop, integer *maxj, integer *nop, real *p1, real *p0, real *res,
          real *tau, real *otau, real *t, real *alp, real *bet, real *s, real
          *p2, real *bound, real *atemp, real *vtemp, real *d__, integer *ind,
          logical *raritz, real *deltal, real *deltar, real *eps, integer *ierr)
          ;

        static int sippla_(S_fp op, S_fp iovect, integer *n, real *xl, real*xr,
          integer *np, integer *nperm, integer *nop, integer *nmval, real *val,
          integer *nmvec, real *vec, integer *nblock, real *h__, real *hv, real
          *p, real *q, real *bound, real *d__, real *deltal, real *deltar,
          logical *raritz, real *eps, integer *ierr);

        static int silaso_(U_fp op, U_fp iovect, integer *n, real *xl, real*xr,
          integer *nfig, integer *nperm, integer *nmval, real *val, integer
          *nmvec, integer *maxvec, real *vec, integer *nblock, integer *maxop,
          integer *maxj, real *work, integer *ind, integer *ierr);

        static real sdot_(integer *n, real *sx, integer *incx, real *sy,
          integer *incy);

        static int scopy_(integer *n, real *sx, integer *incx, real *sy,
          integer *incy);

        static int saxpy_(integer *n, real *sa, real *sx, integer *incx, real
          *sy, integer *incy);

        static int sswap_(integer *n, real *sx, integer *incx, real *sy,
          integer *incy);

        static int snwla_(S_fp op, S_fp iovect, integer *n, integer *nband,
          integer *nval, integer *nfig, integer *nperm, real *val, integer
          *nmvec, real *vec, integer *nblock, integer *maxop, integer *maxj,
          integer *nop, real *p1, real *p0, real *res, real *tau, real *otau,
          real *t, real *alp, real *bet, real *s, real *p2, real *bound, real
          *atemp, real *vtemp, real *d__, integer *ind, logical *small, logical
          *raritz, real *delta, real *eps, integer *ierr);

        static int svsort_(integer *num, real *val, real *res, integer *iflag,
          real *v, integer *nmvec, integer *n, real *vec);
    };
  }
}
